package base.day19.array;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class MyLinkedList {
    public static void main(String[] args) {
        LinkedList<String> linked=new LinkedList<>();
        linked.add("a");
        linked.add("b");
        linked.add("c");
        linked.add("d");

        for (String s : linked) {
            System.out.println(s);
        }
        for (int i = 0; i < linked.size(); i++) {
            String s=linked.get(i);
            System.out.println(s);
        }

        Iterator<String> it=linked.iterator();
        while (it.hasNext()){
            String s=it.next();
            System.out.println(s);
        }
    }
}
